package scottb.flex;

public enum VAlign {

    TOP("top"), CENTER("center"), BOTTOM("bottom");

    private final String align;

    VAlign(final String align) {

        this.align = align;
    }

    public String align() {
        return align;
    }

    public String getAlign() {
        return align;
    }

    public String toString() {
        return align;
    }

    public static VAlign lookup(final String align) {

        if(align == null)
            return null;
        else if(align.length() == 0)
            return null;
        else if(align.equalsIgnoreCase(TOP.align))
            return TOP;
        else if(align.equalsIgnoreCase(CENTER.align))
            return CENTER;
        else if(align.equalsIgnoreCase(BOTTOM.align))
            return BOTTOM;

        throw new IllegalArgumentException(align);
    }
}
